package com.ruoyi.supervise.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.supervise.domain.BaseUnitEngineeringPartInfo;
import com.ruoyi.supervise.domain.MyTest;
import com.ruoyi.supervise.mapper.BaseUnitEngineeringPartInfoMapper;
import com.ruoyi.supervise.mapper.MyTestMapper;
import com.ruoyi.supervise.service.IBaseUnitEngineeringPartInfoService;
import com.ruoyi.supervise.util.FieldStrUtils;

/**
 * @ClassName: MyTestServiceImpl
 * @Description: 测试从数据源
 * @Author wtj
 * @DateTime 2020年3月9日 上午10:41:31
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class BaseUnitEngineeringPartInfoServiceImpl implements IBaseUnitEngineeringPartInfoService 
{
    @Autowired
    private BaseUnitEngineeringPartInfoMapper baseUnitEngineeringPartInfoMapper;

	@Override
	public BaseUnitEngineeringPartInfo selectBaseUnitEngineeringPartInfoByGuid(String guid) {
		BaseUnitEngineeringPartInfo buepi = baseUnitEngineeringPartInfoMapper.selectBaseUnitEngineeringPartInfoByGuid(guid);
		if(buepi!=null) {
			buepi.setSurveyUnit(FieldStrUtils.personOrEnterFieldNot(buepi.getSurveyUnit()));
			buepi.setSurveyMaster(FieldStrUtils.personOrEnterField(buepi.getSurveyMaster()));
			buepi.setDesignUnit(FieldStrUtils.personOrEnterField(buepi.getDesignUnit()));
			buepi.setDesignLinkMaster(FieldStrUtils.personOrEnterField(buepi.getDesignLinkMaster()));
			buepi.setConstructionDwUnit(FieldStrUtils.personOrEnterField(buepi.getConstructionDwUnit()));
			buepi.setConstructionDwMaster(FieldStrUtils.personOrEnterField(buepi.getConstructionDwMaster()));
			buepi.setSupervisionUnit(FieldStrUtils.personOrEnterField(buepi.getSupervisionUnit()));
			buepi.setSupervisionMaster(FieldStrUtils.personOrEnterField(buepi.getSupervisionMaster()));
			buepi.setSupervisorMan(FieldStrUtils.personOrEnterField(buepi.getSupervisorMan()));
		}
		return buepi;
	}
   
}
